Optimal. Leaf size=44 \[ -\frac {3 \tanh ^{-1}(\cos (x))}{2 a}+\frac {2 \cot (x)}{a}-\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \csc (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3903, 3872,
3852, 8, 3853, 3855} \begin {gather*} \frac {2 \cot (x)}{a}-\frac {3 \tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) \csc ^2(x)}{a \csc (x)+a}-\frac {3 \cot (x) \csc (x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 3872
Rule 3903
Rubi steps
\begin {align*} \int \frac {\csc ^4(x)}{a+a \csc (x)} \, dx &=\frac {\cot (x) \csc ^2(x)}{a+a \csc (x)}-\frac {\int \csc ^2(x) (2 a-3 a \csc (x)) \, dx}{a^2}\\ &=\frac {\cot (x) \csc ^2(x)}{a+a \csc (x)}-\frac {2 \int \csc ^2(x) \, dx}{a}+\frac {3 \int \csc ^3(x) \, dx}{a}\\ &=-\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \csc (x)}+\frac {3 \int \csc (x) \, dx}{2 a}+\frac {2 \text {Subst}(\int 1 \, dx,x,\cot (x))}{a}\\ &=-\frac {3 \tanh ^{-1}(\cos (x))}{2 a}+\frac {2 \cot (x)}{a}-\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \csc (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.36, size = 83, normalized size = 1.89 \begin {gather*} \frac {4 \cot \left (\frac {x}{2}\right )-\csc ^2\left (\frac {x}{2}\right )-12 \log \left (\cos \left (\frac {x}{2}\right )\right )+12 \log \left (\sin \left (\frac {x}{2}\right )\right )+\sec ^2\left (\frac {x}{2}\right )-\frac {16 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}-4 \tan \left (\frac {x}{2}\right )}{8 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 54, normalized size = 1.23
method | result | size |
default | \(\frac {\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-2 \tan \left (\frac {x}{2}\right )+\frac {8}{\tan \left (\frac {x}{2}\right )+1}-\frac {1}{2 \tan \left (\frac {x}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {x}{2}\right )}+6 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{4 a}\) | \(54\) |
norman | \(\frac {\frac {3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}-\frac {\tan \left (\frac {x}{2}\right )}{8 a}+\frac {3 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{8 a}-\frac {3 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{8 a}+\frac {\tan ^{6}\left (\frac {x}{2}\right )}{8 a}}{\tan \left (\frac {x}{2}\right )^{3} \left (\tan \left (\frac {x}{2}\right )+1\right )}+\frac {3 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{2 a}\) | \(81\) |
risch | \(\frac {-5 \,{\mathrm e}^{2 i x}+3 i {\mathrm e}^{3 i x}+3 \,{\mathrm e}^{4 i x}+4-i {\mathrm e}^{i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2} \left (i+{\mathrm e}^{i x}\right ) a}+\frac {3 \ln \left ({\mathrm e}^{i x}-1\right )}{2 a}-\frac {3 \ln \left ({\mathrm e}^{i x}+1\right )}{2 a}\) | \(83\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 97 vs.
\(2 (40) = 80\).
time = 0.26, size = 97, normalized size = 2.20 \begin {gather*} -\frac {\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}{8 \, a} + \frac {\frac {3 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {20 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1}{8 \, {\left (\frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}}\right )}} + \frac {3 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (40) = 80\).
time = 2.68, size = 134, normalized size = 3.05 \begin {gather*} \frac {8 \, \cos \left (x\right )^{3} + 6 \, \cos \left (x\right )^{2} - 3 \, {\left (\cos \left (x\right )^{3} + \cos \left (x\right )^{2} + {\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) - \cos \left (x\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + 3 \, {\left (\cos \left (x\right )^{3} + \cos \left (x\right )^{2} + {\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) - \cos \left (x\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 2 \, {\left (4 \, \cos \left (x\right )^{2} + \cos \left (x\right ) - 2\right )} \sin \left (x\right ) - 6 \, \cos \left (x\right ) - 4}{4 \, {\left (a \cos \left (x\right )^{3} + a \cos \left (x\right )^{2} - a \cos \left (x\right ) + {\left (a \cos \left (x\right )^{2} - a\right )} \sin \left (x\right ) - a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc ^{4}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 73, normalized size = 1.66 \begin {gather*} \frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, a} + \frac {a \tan \left (\frac {1}{2} \, x\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, x\right )}{8 \, a^{2}} + \frac {2}{a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}} - \frac {18 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 4 \, \tan \left (\frac {1}{2} \, x\right ) + 1}{8 \, a \tan \left (\frac {1}{2} \, x\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.26, size = 69, normalized size = 1.57 \begin {gather*} \frac {10\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+\frac {3\,\mathrm {tan}\left (\frac {x}{2}\right )}{2}-\frac {1}{2}}{4\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+4\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}-\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2\,a}+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}+\frac {3\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{2\,a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________